﻿<ResourceDictionary x:Class="OpenLS.Spreadsheet.UI.Internals.WorksheetProtectionResources"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:UI="clr-namespace:OpenLS.Spreadsheet.UI.Internals"
                    xmlns:Resources="clr-namespace:OpenLS.Spreadsheet.UI.Internals.Resources"
                    xmlns:Internals="clr-namespace:OpenLS.UI.Internals;assembly=OpenLS.UI">
    <DataTemplate DataType="{x:Type UI:WorksheetProtectionViewModel}">
        <DockPanel>
            <TextBlock Text="{x:Static Resources:UIStringTable.PasswordToUnprotectSheet}" DockPanel.Dock="Top" Name="passwordTitle"></TextBlock>
            <TextBox Text="{Binding Password}" DockPanel.Dock="Top"></TextBox>
            <TextBlock Text="{x:Static Resources:UIStringTable.AllowAllUsersOfThisWorksheetTo_}"  DockPanel.Dock="Top" Name="propertiesTitle"></TextBlock>
            <ListBox Name="properties" >
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding SelectLockedCells}" Content="{x:Static Resources:UIStringTable.SelectLockedCells}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding SelectUnlockedCells}" Content="{x:Static Resources:UIStringTable.SelectUnlockedCells}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding FormatCells}" Content="{x:Static Resources:UIStringTable.FormatCells}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding FormatColumns}" Content="{x:Static Resources:UIStringTable.FormatColumns}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding FormatRows}" Content="{x:Static Resources:UIStringTable.FormatRows}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding InsertColumns}" Content="{x:Static Resources:UIStringTable.InsertColumns}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding InsertRows}" Content="{x:Static Resources:UIStringTable.InsertRows}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding InsertHyperLink}" Content="{x:Static Resources:UIStringTable.InsertHyperlink}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding DeleteColumns}" Content="{x:Static Resources:UIStringTable.DeleteColumns}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding DeleteRows}" Content="{x:Static Resources:UIStringTable.DeleteRows}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding Sort}" Content="{x:Static Resources:UIStringTable.Sort}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding UseAutoFilter}" Content="{x:Static Resources:UIStringTable.UseAutoFilter}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding UsePivotTableReports}" Content="{x:Static Resources:UIStringTable.UsePivotTableReports}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding EditObjects}" Content="{x:Static Resources:UIStringTable.EditObjects}"></CheckBox>
                </ListBoxItem>
                <ListBoxItem>
                    <CheckBox IsChecked="{Binding EditScenarios}" Content="{x:Static Resources:UIStringTable.EditScenarios}"></CheckBox>
                </ListBoxItem>
            </ListBox>
        </DockPanel>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding HasProtection}" Value="true">
                <Setter TargetName="passwordTitle" Value="Collapsed" Property="Visibility"></Setter>
                <Setter TargetName="propertiesTitle" Value="Collapsed" Property="Visibility"></Setter>
                <Setter TargetName="properties" Value="Collapsed" Property="Visibility"></Setter>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
</ResourceDictionary>
